package com.zhuanyongjin.server;

import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.zhuanyongjin.dao.member_informationDao;
import com.zhuanyongjin.dao.new_informationDao;
import com.zhuanyongjin.dao.impl.member_informationDaoImpl;
import com.zhuanyongjin.dao.impl.new_informationDaoImpl;

public class pinlunmember_informationServlet extends HttpServlet {

	/**
	 * The doGet method of the servlet. <br>
	 *
	 * This method is called when a form has its tag value method equals to get.
	 * 
	 * @param request the request send by the client to the server
	 * @param response the response send by the server to the client
	 * @throws ServletException if an error occurred
	 * @throws IOException if an error occurred
	 */
	public void doGet(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {

		response.setContentType("text/html");
		PrintWriter out = response.getWriter();
		String comment_content=request.getParameter("comment_content");
		String member_id=request.getParameter("member_id");
		int information_id=Integer.parseInt(request.getParameter("information_id"));
		member_informationDao member_yongjins = new member_informationDaoImpl();
		new_informationDao new_informations=new new_informationDaoImpl();
		boolean b2=member_yongjins.pinlunmember_information(member_id,information_id,comment_content);
		boolean b1=new_informations.pinglunnew_information(information_id);
		out.flush();
		out.close();
	}

	/**
	 * The doPost method of the servlet. <br>
	 *
	 * This method is called when a form has its tag value method equals to post.
	 * 
	 * @param request the request send by the client to the server
	 * @param response the response send by the server to the client
	 * @throws ServletException if an error occurred
	 * @throws IOException if an error occurred
	 */
	public void doPost(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {
		doGet(request, response);
	}

}
